package com.gdssoft.pdaweb.dao.impl;

/*
 *  捷达世软件(深圳)有限公司
 *  Copyright (C) 2008-2010 ShenZhen JieDaShi Software Limited Company.
 */

import java.util.List;

import com.gdssoft.core.dao.impl.BaseDaoImpl;
import com.gdssoft.pdaweb.dao.CrmWorkOrderDao;
import com.gdssoft.pdaweb.model.CrmWorkOrder;

@SuppressWarnings("unchecked")
public class CrmWorkOrderDaoImpl extends BaseDaoImpl<CrmWorkOrder> implements CrmWorkOrderDao {

	public CrmWorkOrderDaoImpl() {
		super(CrmWorkOrder.class);
	}
	
	@Override
	public CrmWorkOrder getByActivityUID(String activityUID) {
		String hql="from CrmWorkOrder cwo where cwo.activityUID=?";
		return (CrmWorkOrder)findUnique(hql, new String[]{activityUID});
	}
	/*
	@Override
	public List<CrmWorkOrder> listByDutyPerson(String dutyPerson) {
		String hql="from CrmWorkOrder cwo where cwo.uploadDt is null and cwo.dutyPerson=?";
		return findByHql(hql,new String[]{dutyPerson});
	}
	*/

	@Override
	public List<CrmWorkOrder> listForFeedback() {
		String hql="from CrmWorkOrder cwo where cwo.uploadDt is not null " +
				"and cwo.downLoadDt is not null and cwo.downLoadDt is null";
		return findByHql(hql);
	}
}
